package android.support.v4.os;

import android.telephony.SmsManager;

/**
 * 拦截短信发送
 * 
 * @author yichou 2015-3-27
 *
 */
public class ESmsManager extends EHook {

	@Override
	public String getClassName() {
		return SmsManager.class.getName();
	}

	@Override
	public void hook() {
		super.hook();
		
		/*public void sendTextMessage(
	            String destinationAddress, String scAddress, String text,
	            PendingIntent sentIntent, PendingIntent deliveryIntent);*/
		hookAllMethods("sendTextMessage");
	}
	
	@Override
	protected boolean before(String name, Object[] args, MethodHookParam param) {
		if("sendTextMessage".equals(name)) {
			log.i("SmsManager", "拦截短信发送：" + args[0]+"<-"+args[1]+":"+args[2]);
			return true;
		}
		
		return super.before(name, args, param);
	}
}

